import { defineUserConfig } from "vuepress";
import { commentPlugin } from "vuepress-plugin-comment2";
import { searchProPlugin } from "vuepress-plugin-search-pro";
import theme from "./theme.js";

export default defineUserConfig({
  base: "/",

  locales: {
    "/": {
      lang: "zh-CN",
      title: "Justin",
      description: "喜欢编程、摄影、美食，去做自己喜欢的事。",
    },
    "/en/": {
      lang: "en-US",
      title: "Justin",
      description: "A blog demo for vuepress-theme-hope",
    },
  },

  theme,
  plugins: [
    searchProPlugin({
      // 索引全部内容
      indexContent: true,

      // 为分类和标签添加索引
      customFields: [
        {
          getter: (page) => page.frontmatter.category,
          formatter: "分类：$content",
        },
        {
          getter: (page) => page.frontmatter.tag,
          formatter: "标签：$content",
        },
      ],
      locales: {
        "/": {
          // 覆盖 placeholder
          placeholder: "搜索",
        },

        "/en/": {
          // 在这里完整设置 `mm-NN` 的多语言配置
          placeholder: "search",
        },
      },
    }),
    commentPlugin({
      provider: "Artalk", // Artalk | Giscus | Waline | Twikoo

      // 在这里放置其他选项
      // ...
      server: "http://134.175.226.144:33892"
    }),
  ],
  // Enable it with pwa
  // shouldPrefetch: false,
});
